<template>
	<view>
		<image :src="userInfo.avatarUrl" mode=""></image>
		<text>{{ userInfo.nickName }}</text>
	</view>
</template>

<script>
	import carMixins from '../../mixins/car.mixins.js'
	export default {
		mixins: [carMixins],
		methods: {
			wxGetUserInfo() {
				uni.getUserInfo({
					success: resp => {
						console.log(resp)
						this.userInfo = resp.userInfo;
						uni.setStorageSync('nickname', this.userInfo.nickName)
						uni.setStorageSync('avator', this.userInfo.avatarUrl)
					},
					fail: error => {
						console.log(error)
					}
				})
			},
		},
		data() {
			return {
				userInfo: {} 
			}
		},
		onLoad() {
			// #ifdef MP-WEIXIN
			this.wxGetUserInfo();
			// #endif
		}
	}
</script>

<style lang="scss">

</style>